<extend name="Public/base"/>
<block name="body">
    <div class="main-title" style="padding-bottom: 10px;">
        <h2>月结报表查看</h2>
    </div>
    <div class="cf">
    <form action="{:U('SpReport/overallmonth')}" method='post' id="form-search" style="float: left;">
        <select name="shopId" id="shopId" class="search-input">
            <option value='-1'>全部门店</option>
            <volist name='shoplist' id='vo'>
                <option value='{$vo.id}'<if condition="$vo.id eq $shopid">selected="selected"</if>>{$vo.name}</option>
            </volist>
        </select>
        开始时间：<input type="text" id="datetimeBegin" name="beginTime" value="{$beginTime}" />
        截止时间：<input type="text" id="datetimeEnd" name="endTime" value="{$endTime}" />
        <input type="submit" class="btn btn-primary" value="统计"/>
    </form>
        <div class="fl" style="float: left; margin-left: 15px;">
            <form method='POST' action="{:U('ExportOverallMonth')}" id="form-export">
                <input type="hidden" id="shoplist" name="shopId" value=""/>
                <input type="hidden" id="beginTime" name="beginTime" value=""/>
                <input type="hidden" id="endTime" name="endTime" value=""/>
                <a class="btn btn-default" href="javascript:;" id="ExportSubmit" onclick="return getValue()">导出</a>
            </form>
        </div>
    </div>
    <div style="color: red;font-size: 16px;">
        当前时间段销售总额：{$sellAmountAll_month}&nbsp;&nbsp;
        当前时间段支付总额：{$payAmountAll_month}
    </div>
    <div class="data-table table-striped" style="font-size: 13px;">
        <table>
            <thead>
            <tr>
                <th>日期</th>
                <th>直果汁</th>
                <th>直水果</th>
                <th>直小吃</th>
                <th>直套餐</th>
                <th>直处理品</th>
                <th>直耗材</th>
                <th>直服务费</th>
                <th>团果汁</th>
                <th>团水果</th>
                <th>团小吃</th>
                <th>团套餐</th>
                <th>线上果汁</th>
                <th style="color: red;">合计</th>
                <th>现金</th>
                <th>银联</th>
                <th>会员卡</th>
                <th>支付宝</th>
                <th>美团</th>
                <th>百度糯米</th>
                <th>饿了么</th>
                <th style="color: red;">合计</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td>{$vo[0]} </td>
                        <td>{$vo[1]} </td>
                        <td>{$vo[2]} </td>
                        <td>{$vo[3]} </td>
                        <td>{$vo[4]} </td>
                        <td>{$vo[5]} </td>
                        <td>{$vo[6]} </td>
                        <td>{$vo[7]} </td>
                        <td>{$vo[8]} </td>
                        <td>{$vo[9]} </td>
                        <td>{$vo[10]} </td>
                        <td>{$vo[11]} </td>
                        <td>{$vo[12]} </td>
                        <td>{$vo[13]} </td>
                        <td>{$vo[14]} </td>
                        <td>{$vo[15]} </td>
                        <td>{$vo[16]} </td>
                        <td>{$vo[17]} </td>
                        <td>{$vo[18]} </td>
                        <td>{$vo[19]} </td>
                        <td>{$vo[20]} </td>
                        <td>{$vo[21]} </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="25" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
        //搜索查询
        $('#submit').click(function () {
            document.getElementById("form-search").submit()
        });
        //导航高亮
        highlight_subnav('{:U('SpReport/overallmonth')}');

        $(function () {
            $('#datetimeBegin').datetimepicker({
                timepicker:false,
                format:'Y-m-d',
                language: 'zh-CN',
                autoclose: true
            });
            $('#datetimeEnd').datetimepicker({
                timepicker:false,
                format:'Y-m-d',
                language: 'zh-CN',
                autoclose: true
            });
        })

        function getValue(){
            if($("#shopId option:selected").val().length>0&&$("#datetimeBegin").val().length>0&&$("#datetimeEnd").val().length>0){
                $("#shoplist").val($("#shopId").val()) ;
                $("#beginTime").val($("#datetimeBegin").val()) ;
                $("#endTime").val($("#datetimeEnd").val()) ;
                document.getElementById("form-export").submit();
            } else {
                return false;
            }
        }
    </script>
</block>